<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>阈值列表</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">

		<!--标准mui.css-->
		<link rel="stylesheet" href="css/mui.min.css">
		<!--App自定义的css-->
		<link rel="stylesheet" type="text/css" href="capp.css"/>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		    <h1 class="mui-title">阈值列表</h1>
			<div class="mui-action-menu mui-icon  mui-pull-right">
				<button class="mui-btn mui-btn-primary" type="button" onclick="Threshold_Add();" style="top:0px; line-height: 1;">新增</button>
			</div>
		</header>
		<div class="mui-content">
		    <div class="mui-card">
		        <ul class="mui-table-view" id="ulUserList">	

		        </ul>
		    </div>
		</div>
	</body>
	<script src="js/mui.min.js"></script>	
	<script src="js/jquery.min.js"></script>
	<script src="libs/lib.js"></script>
	<script>
		mui.init({
			swipeBack:true //启用右滑关闭功能
		});
		
		Threshold_Get_List();
		
		function Threshold_Get_List(){
			var param = {};
			Core.Post("Threshold/List", param, function(result, status){
				if(result.errorMsg){
					Core.Msg.Alert(result.errorMsg);
					return;
				}
				var list = result.data;
				if(!list)
					return;
				
				var html = "";
				for(var i=0;i<list.length;i++){
					html += "<li class='mui-table-view-cell' onclick='Threshold_Edit_One("+list[i].id+")'>";
					html += " <div class='mui-table-cell mui-col-sm-8'> ";
					html += " 	<h4 class='mui-ellipsis'>"+list[i].name+"</h4> ";
					html += " 	<h5>范围："+list[i].startValue+"-"+list[i].endValue+"</h5>								 ";
					html += " </div> ";
					html += "<div class='mui-table-cell mui-col-sm-4 mui-text-right'> ";
					html += " 	<span class='mui-h5'>"+list[i].createTime+"</span> ";
					html += "</div> ";
					html += "</li> ";
				}
				document.getElementById("ulUserList").innerHTML = html;
			});
		}
		function Threshold_Add(){
			window.location.href = "threshold_eidt.html";
		}
		function Threshold_Edit_One(id){
			window.location.href = "threshold_eidt.html?id="+id;
		}
	</script>
</html>